package com.wushijia.listener;//package com.wushijia.listener;
//
//import com.wushijia.filter.MyFilter;
//import java.util.EnumSet;
//import javax.servlet.DispatcherType;
//import javax.servlet.FilterRegistration;
//import javax.servlet.ServletContext;
//import javax.servlet.ServletContextEvent;
//import javax.servlet.ServletContextListener;
//import javax.servlet.annotation.WebListener;
//
//@WebListener
//public class Configurator implements ServletContextListener {
//
//  @Override
//  public void contextInitialized(ServletContextEvent servletContextEvent) {
//    ServletContext servletContext = servletContextEvent.getServletContext();
//    FilterRegistration.Dynamic registration = servletContext.addFilter("myFilter", new MyFilter());
//    registration.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST, DispatcherType.ASYNC), false, "/");
//    registration.addMappingForServletNames(EnumSet.of(DispatcherType.REQUEST, DispatcherType.ASYNC), false, "myServlet");
//  }
//
//  @Override
//  public void contextDestroyed(ServletContextEvent servletContextEvent) {
//
//  }
//}
